//
//  SEGActivityDeletedView.m
//  ExcellentHome
//
//  Created by 揭婧雯 on 2017/8/19.
//  Copyright © 2017年 陈区. All rights reserved.
//

#import "SEGActivityDeletedView.h"

@implementation SEGActivityDeletedView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        [self customView];
    }
    return self;
}

- (void)customView
{
    self.backgroundColor = kColor_W;
    
    UIImage *image = [UIImage imageWithContentsOfFile:SEGPicName(@"pic_default_delete")];
    UIImageView *imageView = [[UIImageView alloc] initWithImage:image];
    [self addSubview:imageView];
    imageView.frame = CGRectMake((CGRectGetWidth(self.frame) - image.size.width) / 2.0, 130, image.size.width, image.size.height);
    
    UILabel *label = [[UILabel alloc] init];
    label.font = kFont_13;
    label.textColor = kColor_3;
    label.textAlignment = NSTextAlignmentCenter;
    label.numberOfLines = 2;
    
    label.text = @"亲，你来晚了，活动已经结束！";
    [self addSubview:label];
    label.frame = CGRectMake(0, CGRectGetMaxY(imageView.frame) + 20, LYScreenWidth(), 35);
    
    UIButton *button = [[UIButton alloc] init];
    [button setTitle:@"点击看看其他活动" forState:UIControlStateNormal];
    [button setTitleColor:kColor_1 forState:UIControlStateNormal];
    button.titleLabel.font = kFont_16;
    button.layer.masksToBounds = YES;
    button.layer.cornerRadius = 4;
    button.layer.borderWidth = 1;
    button.layer.borderColor = kColor_1.CGColor;
    [button addTarget:self action:@selector(seg_buttonPressed) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:button];
    button.frame = CGRectMake((LYScreenWidth() - 175.0) / 2.0, CGRectGetMaxY(label.frame) + 40.0, 175.0, 35.0);
}

- (void)seg_buttonPressed
{
    if (self.delegate && [self.delegate respondsToSelector:@selector(goToAllActivityVC)]) {
        [self.delegate goToAllActivityVC];
    }
}

@end
